/*
 *   Copyright 2021 zzh
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.aduib.boot.common.SPI.metadata;

import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;

/**
 * @description: DefaultFieldMetaData
 * @author: zzh
 * @date: 2021/11/1 13:27
 */
public class DefaultFieldMetaData extends AbstractMetaData implements FieldMetaData {

  private Class<?> fieldType;

  private Object fieldValue;

  public DefaultFieldMetaData(
      Annotation[] annotations,
      AccessibleObject accessibleObject,
      String simpleName,
      int modifiers,
      Class<?> fieldType,
      Object fieldValue) {
    super(annotations, accessibleObject, simpleName, modifiers);
    this.fieldType = fieldType;
    this.fieldValue = fieldValue;
  }

  @Override
  public Class<?> getFieldType() {
    return fieldType;
  }

  @Override
  public Object getFieldValue() {
    return fieldValue;
  }

  @Override
  public void setFieldValue(Object fieldValue) {
    this.fieldValue = fieldValue;
  }
}
